<template>
  <div class="recycling">
    <van-nav-bar
      v-if="$route.query.hideH5Nav == 'false'"
      :title="t('recyling.pageTitle')"
      left-arrow
      :fixed="true"
      @click-left="onClickLeft"
    />
    <div
      :class="$route.query.hideH5Nav == 'false' ? 'header navStyle' : 'header'"
    >
      <div class="header-left">
        <p class="title">{{ $t("recyling.text1") }}</p>
        <p class="supplyCon">{{ $t("recyling.text2") }}</p>
      </div>
      <div class="header-right">
        <img src="/image/recycling/header-bg.svg" alt="" />
      </div>

      <div class="content">
        <div class="group1">
          <p class="describe">
            {{ $t("recyling.text3") }}
          </p>
          <p class="describe">
            {{ $t("recyling.text4") }}
          </p>
        </div>
        <p class="title">{{ $t("recyling.text5") }}</p>
        <div class="group2">
          <ol>
            <li class="describe">{{ $t("recyling.text6") }}</li>
            <li class="describe">{{ $t("recyling.text7") }}</li>
            <li class="describe">{{ $t("recyling.text8") }}</li>
            <li class="describe">{{ $t("recyling.text9") }}</li>
          </ol>
          <div class="steps" ref="steps">
            <div class="steps-item" :style="{ height: domH + 'px' }">
              <p>{{ $t("recyling.text10") }}</p>
            </div>
            <div class="point"></div>
            <div class="steps-item" :style="{ height: domH + 'px' }">
              <p>{{ $t("recyling.text11") }}</p>
            </div>
            <div class="point"></div>
            <div class="steps-item" :style="{ height: domH + 'px' }">
              <p>{{ $t("recyling.text12") }}</p>
            </div>
            <div class="point"></div>
            <div class="steps-item" :style="{ height: domH + 'px' }">
              <p>{{ $t("recyling.text13") }}</p>
            </div>
          </div>
        </div>

        <div class="group3">
          <p class="describe">
            {{ $t("recyling.text14") }}
          </p>
        </div>
      </div>
    </div>
  </div>
</template>
<script setup>
const { t } = useI18n();
const $router = useRouter(); // 路由跳转
const onClickLeft = () => {
  $router.go(-1);
};
const domH = ref(null);
const resizeH = () => {
  if (process.client) {
    let dom = ref(document.getElementsByClassName("steps-item"));
    domH.value = dom.value[3].clientHeight;
  }
};

onMounted(() => {
  resizeH();
});
</script>
<style lang="scss" scoped>
.recycling {
  background-image: linear-gradient(45deg, #fff, #fffbf0 100%);
  //position: relative;
  height: 100vh;
  overflow-y: scroll;
  .navStyle {
    margin-top: 94px;
  }
  .header {
    display: flex;
    justify-content: space-between;
    padding: 40px 50px;
    position: relative;
    .header-left {
      width: 80%;
      font-size: 48px;
      .title {
        color: var(--Dark-Blue, #002853);
        font-size: 48px;
        line-height: 60px;
      }
      .supplyCon {
        color: #f90;
        font-weight: 700;
        line-height: 1.875rem;
      }
    }
    .header-right {
      width: 260px;
      height: 200px;
      overflow: hidden;
      img {
        width: 100%;
        //margin-top: 20px;
      }
    }

    .content {
      padding: 0 30px;
      position: absolute;
      top: 220px;
      left: 0;
      .group1 {
        background: linear-gradient(248deg, #fff 0%, #fffceb 100%);
        border-radius: 24px;
        padding: 30px;
        margin-bottom: 40px;
        border: 1px solid #ffb800;
        p:first-child {
          margin-bottom: 40px;
        }
      }

      .group2 {
        background: #fff;
        border-radius: 24px;
        margin-top: 20px;
        ol {
          list-style: normal;
          margin-left: 40px;
        }
        .steps {
          display: flex;
          justify-content: center;
          align-items: center;
          margin: 30px 0 10px 0;
          border: 1px solid #ffb800;
          border-radius: 24px;
          padding: 20px;
          .point {
            width: 0;
            height: 0;
            border-top: 6px solid transparent;
            border-left: 12px solid #ffb800;
            border-bottom: 6px solid transparent;
            margin-left: 8px;
            margin-right: 5px;
          }
          .steps-item {
            width: 140px;
            //height: 120px;
            padding: 10px 0;
            text-align: center;
            display: flex;
            justify-content: center;
            align-items: center;
            border-radius: 6px;
            box-shadow: 0px 5px 10px -5px #ff9a00;
            background: linear-gradient(180deg, #ffb800 0%, #f90 100%);
            p {
              font-size: 16px;
              transform: scale(0.9);
              color: #fff;
            }
          }
        }
        .step-text {
          display: flex;
          justify-content: center;
          align-items: center;
          span {
            display: inline-block;
            width: 25%;
            text-align: center;
            color: var(--Brand-Blue, #007bff);
            font-size: 22px;
            font-weight: 590;
            &:first-child {
              width: 15%;
            }
            &:nth-child(2) {
              width: 35%;
            }
          }
        }
      }

      .group3 {
        margin-top: 20px;
        padding-bottom: 100px;
      }
    }
  }
}
.group-title {
  font-size: 30px;
  font-weight: 590;
  color: var(--Brand-Blue, #007bff);
  line-height: 40px;
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  .icon {
    width: 36px;
    height: 36px;
    line-height: 36px;
    background: #007bff;
    color: #fff;
    font-size: 15px;
    text-align: center;
    border-radius: 50%;
    margin-right: 10px;
  }
}
.title {
  color: var(--Black-Blue, #141924);
  font-weight: 590;
  line-height: 40px;
  font-size: 30px;
}
.describe {
  color: var(--Black-Blue, #141924);
  font-size: 26px;
  font-weight: 400;
  line-height: 36px;
  font-weight: 400;
}
.operator {
  font-size: 32px;
  font-weight: bold;
  color: var(--Black-Blue, #141924);
  margin: 0 10px;
}
.per {
  color: var(--Brand-Blue, #007bff);
  font-size: 34px;
  font-weight: 590;
  line-height: 44px;
}
.desc {
  color: var(--Gray, #797c83);
  font-weight: 400;
  font-size: 22px;
}
</style>
